Questions about getAttr() and array

Hi, I’m trying to using the getAttr() function to return something .Here are several questions for Expression Editor, If these features are not available through Expression Editor, just let me know then I’ll try custom code.

  1. We have pull-down menu for Attr in other function such like Line Manager of User but getAttr(), I tried to enter ‘Name’ into the attribute but it seems not work, how to use them actrually?
    image

  2. You can see I changed the language into English, but the Attr showed is still in Japanese, will there be any affect? Should I put the ‘Name’ in Japanese when I using Japanese? (tried, not work)

3.I found the arrayIndex() function to get the index from value, conversely, how to get the value from index?

@john55ww

  1. getAttr function only works for a JavaScript object. The property will be returned if the obj actually has it. You cannot use it to get a property from a user variable in most cases, as the user variable only has an ID in it. Instead, you can use getUserAttr function to get property from a user. By providing the user variable in first parameter, the function will call API to retrieve the property to you.

  2. In User Management module, admin can change the display name of a field. It will be shown as customized value regardless of the language. Please let me know the repro steps if it is not the scenario described.

  1. You can use getAttr function to get the value form index by simply set index number as the attribute. As the following example, the value of a checkbox control is an array, the formula will retrieve the second item from the value. BTW, you can get any property from a JavaScript object by providing the property path, like 1.attr1.attr2

image

image

@frank Nice for we can get attribute by index. Thank you very much for the explanation!