Skip to main content

Search

Get Item Action - Pull Specific Column Data

Comments

9 comments

  • skybow Support

    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 regards
    skybow Support Team
    0
  • Dan Thale

    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]][0].HolidayHours : ""

    When I run the action, I just get a blank field. 

    Any other options to try?

    0
  • Christof

    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]][0].HolidayHours : 0
    0
  • Dan Thale

    Christof, 

    Thanks! It was set to assignment, but something was weird with the HolidayHours column. I deleted it, and recreated and now it's working. ¯\_(ツ)_/¯

    Thanks!

    0
  • Joerg_K.

    Christof - How can I retrieve 

    [[@Actions.Get_items.Items]][0].Host

    further data if the field is a Lookup or Person field?

    Like retrieving the LoginName of a person or the value of a Lookup field?

    Currently I do get this as a result: 

    Microsoft.SharePoint.Client.FieldUserValue, but not the actual person
    Microsoft.SharePoint.Client.FieldLookupValue, but not the actual value

    [[@Actions.Get_items.HtmlTable]] shows the values as expected.

    Example: I use =[[@Actions.Get_Meeting.Items]][0].Organisator where Organisator is a Person field, but other than .Email is not returning anything? I tried .Title, .LoginName, .UserName and many more...

    However, for the person field I need to retrieve more information, like the LoginName (to make further lookups at the Entra ID (AD), like FirstName, LastName and Company).

    1
  • Vladyslav Noskov

    Hi Joerg.

    It seems you are using the Get Items action in the Scheduled or Triggered action, and the item values for User or Lookup fields are being returned as CSOM objects (FieldUserValue, FieldLookupValue).
    To retrieve the values from these fields, you can try the following:

    1. For Lookup Fields:

    =[[@Actions.Get_Meeting.Items]][0].LookupField.LookupId
    =[[@Actions.Get_Meeting.Items]][0].LookupField.LookupValue


    2. For User Fields:

    =[[@Actions.Get_Meeting.Items]][0].Organisator.Email
    =[[@Actions.Get_Meeting.Items]][0].Organisator.LookupId
    =[[@Actions.Get_Meeting.Items]][0].Organisator.LookupValue

    All other user information is stored in SharePoint's internal User Information List. I think it should be possible to retrieve additional details using the UserField.LookupId value.

    Hope it can help you.

    0
  • Joerg_K.

    Vladyslav Noskov many thanks how can I retrieve the login name of the person field here?

    =[[@Actions.Get_Meeting.Items]][0].Organisator.LookupValue


    I retrieve the display name with the above. ...Organisator.Email gives the email address.

    For the lookup field it worked and I can use the "LookupValue" to retrieve the "value" of the LookupField 

    =[[@Actions.Get_Meeting.Items]][0].Standort.LookupValue

    gives back the City Name of the lookup.

    0
  • Vladyslav Noskov

    Hi Joerg.

    The FieldUserValue object does not include a property for the login name

    For the Scheduled/Triggered actions Get user profile action should be available in the Action Builder.

    Since you have Email you can use it in this action and get all the user information you need (e.g. AccountName) from the action output. It requires skybow Users Connector to be approved on the source solution and as well on the deployment.

    Here is an Article with all the deatils.

    Hope it can help you.

    0
  • Joerg_K.

    Vladyslav Noskov you are right, I forgot about the action :) thanks for reminding me. Have a great day, many thanks again and happy holidays!

    0

Please sign in to leave a comment.