How to set "Update Record" action in Flow Designer to add "1" to the Integer field's value?

Aki18
Tera Contributor

In the Flow Designer, I would like to set "Update Record" action that updates an integer field to add "1" like below:

Field_A's current value: 0

--> Update the value to "1" (0 + 1) with the flow action.

*I'm planning to use this field to set a loop action using "Do the following until" flow logic.

 

Please let me know how to add (increase) number in the "Update Record" action.

 

Best Regards,

Aki

1 ACCEPTED SOLUTION

Toggle to Scripting

ChinmayTawade1_0-1666256558988.png

Click on the Highlighted icon to toggle to script.

ChinmayTawade1_1-1666256639210.png

This Script box appears where you can write the code.

Write below script - 

return fd_data._1__look_up_record.record.quantity +1;
ChinmayTawade1_2-1666257009188.png

 

 
And about how to populate fd_data.
You can simply write fd_data. and press ctrl+spacebar to get the datapills. It is ame like drag and drop of data pills but through script - Using script you can manipulate the data, In your case we are taking Quantity and increase it by 1.

 

Thnaks,

Chinmay.

 

If this anwer has helped you then please mark as this answer as correct.

 

View solution in original post

4 REPLIES 4

Ahmmed Ali
Mega Sage

Hello @Aki18 

 

You can use write script to read the integer data and add 1 to it in field mapping script.

 

 

Below is example I did in PDI for knowledge view count update:

AhmmedAli_0-1666250392004.png

 

You need to select your update record step after fd_data. in above script.

 

Hope this helps.

 

Thanks,

Ali

If I could help you with your Query then, please hit the Thumb Icon and mark my answer as Correct!!

Thank you,
Ali

Aki18
Tera Contributor

Hi @Ahmmed Ali ,

Thank you for your reply, but could you tell me how to get and populate the script "fd_data.~~~"? Can I drag&drop to populate it?

Hello @Aki18 

 

Just open the script editor in field map using the icon pointed in my last answer, the script editor, when you type "fd_data." , you will automatically get suggestions for available data points in the flow.

 

Let me know for any issue.

 

Thank you,

Ali

If I could help you with your Query then, please hit the Thumb Icon and mark my answer as Correct!!

Thank you,
Ali

Toggle to Scripting

ChinmayTawade1_0-1666256558988.png

Click on the Highlighted icon to toggle to script.

ChinmayTawade1_1-1666256639210.png

This Script box appears where you can write the code.

Write below script - 

return fd_data._1__look_up_record.record.quantity +1;
ChinmayTawade1_2-1666257009188.png

 

 
And about how to populate fd_data.
You can simply write fd_data. and press ctrl+spacebar to get the datapills. It is ame like drag and drop of data pills but through script - Using script you can manipulate the data, In your case we are taking Quantity and increase it by 1.

 

Thnaks,

Chinmay.

 

If this anwer has helped you then please mark as this answer as correct.