Get Item Action - Pull Specific Column Data
I am using the Get Items action to populate a field using the Set Form Field action. How do I specify which column to use when the output of the Get Items action equals [[@Actions.Get_items.Items]]? Thanks!
Hi Dan Thale,
with the action "Get Items" it could potentially return more than just one item and as an array. Therefore you would have to check if there are items in the array using .length>0 and then return the first element in the array and the internal field name as here:
An alternative could be to use our GetFirstValueForQuery function in the Set Form Field action directly without using the Get Items first.Kind regardsskybow Support Team0
Thank you for the reply. I've tried both solutions and am not able get either to work. The second option gave me the error "One or more field types are not installed properly. Go to the list settings page to delete these fields." So, I'm focused on the first solution as I feel I'll have the most success there.
Here is the XML version of my Get Items CAML Query which returns the correct employee.
The column data which I want to use is "HolidayHours" which is a number field.
Here is the assignment code for the Set Field Value that is triggered by a command bar action:
[[@Actions.Get_items.Items]].length>0 ? [[@Actions.Get_items.Items]].HolidayHours : ""
When I run the action, I just get a blank field.
Any other options to try?0
Your configuration looks ok.
Make sure you select "Assignment" expression type for the expression you added to the Set Field Value action.
"Assignment" expression starts with an "=" - so your expression should look like this in the end (without the leading "=" it's defined as "Template" expression):
=[[@Actions.Get_items.Items]].length>0 ? [[@Actions.Get_items.Items]].HolidayHours : 00
Thanks! It was set to assignment, but something was weird with the HolidayHours column. I deleted it, and recreated and now it's working. ¯\_(ツ)_/¯
Please sign in to leave a comment.