Hi,
I am trying to update file size under a custom field, in *GB notation ((Decimal) ( Ex: 2 GB/2.5 GB/ 0.3 GB)). But i am getting an output size as 732658926.
Please find the attached example procedure image for your reference.
Thanks in advance..
Regards,
Sumanth
Attaching my procedure.
Hello Sumanth,
Here is an example you can use to get File Size converted into GB. I used a multiplication to ensure there's no division by 0 error in case of 0 bytes file size.
It is "rounded" but should be fine. Otherwise change Expression Value with a full division as needed.
<ScriptExport><Procedure name="Test2" treePres="3" id="2094652513" folderId="477685157804603" treeFullPath="myProcedures - alessandrodimarco"><Body description=""><Statement name="GetVariable" continueOnFail="false"><Parameter xsi:type="EnumParameter" name="VariableType" value="FileSize"/><Parameter xsi:type="StringParameter" name="SourceContent" value="#vAgentConfiguration.AgentTempDir#\Klicense.exe"/><Parameter xsi:type="StringParameter" name="VariableName" value="FSize"/></Statement><Statement name="GetVariable" continueOnFail="false"><Parameter xsi:type="EnumParameter" name="VariableType" value="ExpressionValue"/><Parameter xsi:type="StringParameter" name="SourceContent" value="(#FSize# * 0.00000000093 )"/><Parameter xsi:type="StringParameter" name="VariableName" value="FSizeGb"/></Statement><Statement name="SendMessage" continueOnFail="false"><Parameter xsi:type="StringParameter" name="Message" value="#FSizeGb#"/><Parameter xsi:type="BooleanParameter" name="Immediate" value="False"/></Statement></Body></Procedure></ScriptExport>
Somehow the editor did not save the image I pasted...
Marco,
Thanks for your that..
Can you please post above xml as procedure. As i am unable to import the given xml procedure.
Getting the error like "The text you are trying to import is not a valid XML import format."
Thanks & regards,
Thanks Marco it's working like a spark...
My previous post has a picture that shows each step to do (it is easy to do it from scratch manually as it is only 3 steps).
The key is to use a GetVariable using Evaluation Formula and put your expression there to divide bytes and get GB.
Alex
Thanks Alex for clear explanation...