Skip to main content
New Participant
Nov 1, 2022 1:20 PM UTC
Solved

Only return integer from list of map value

I have the above expression rule, and when I call it in my interface I am getting the value of [ID:7]. Is there a way to only return the integer value of 7? I'm sure this is probably an easy fix, I'm just very new to this

    mikes0011
    mikes0011Answer
    Brainy
    Nov 1, 2022 2:13 PM UTC
    index function

    This will work, however, I personally recommend that when fetching a property (i.e. the "ID" property of this record type), as opposed to an index (being the term for the position of a data item within an array), we should use the property() function instead of index(), if just for readability and code consistency, even though both functions allegedly act identically behind-the-scenes.

    The Expression Guru

    4 replies

    amans0009
    Participating Frequently
    Nov 1, 2022 1:38 PM UTC

    wrap this into an index function

    index(a!query(your-query).data,"ID",{})

    New Participant
    Nov 1, 2022 1:42 PM UTC

    thank you so much!