UiDemo TryParse Failed

Hi!

My question today is about TryParse. I did the TryParse according to the workflow in UiDemo, but it didnt work! (The value in the CashIn did not transfer to dbl_CashIn). I wonder what is the problem?

Can you share the code you used in TryParse?

1 Like

Hi @Anthony_Humphries,

Yes, here is my code!

Can you share your project in a ZIP file?

1 Like

Hi @Anthony_Humphries,

Yes, for sure!
Here is my zip file with one transaction in it, where the Cash in is 1001, so it should return an error in the condition when Cash_In is > 1000, but it did not.

Thanks for your help!

UiDemo Practice.zip (1.7 MB)

Use Step Into to see what dbl_CashIn and CashIn are when it gets to the “CashIn <1000” Flow Decision. I think a different values are being loaded to Orchestrator than are in the Excel file.

1 Like

Hi Antony,

I used the step into activity, but it doesn’t transfer the CashIn to dbl_CashIn. I tried in the debug mode previously. :frowning:

The values I used is the values I created to make sure that CashIn is >1000, so I can make sure that dbl_CashIn returns a business exception when it gets there.
image

Double.TryParse will just return a true or false value. You should assign the Parsed Value explicitly using Assign activity and Double.Parse.

ex.

Assign dbl_CashIn = Double.Parse(CashIn) or
Assign dbl_CashIn = CDBL(CashIn)

2 Likes

That works! :smiley:

Thanks @Emman_Pelayo

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.