web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Combo box with id and ...
Power Apps
Answered

Combo box with id and display value, won't save id

(0) ShareShare
ReportReport
Posted on by 212

I have a combo box with the following command in Items which displays nicely

 

ForAll( audit,
{CID: ID,
cboDisplay: ID & " - " & ContractPeriod.Value & ": " & Text(DateValue('ContractPeriod:BegDate'.Value,"en-US"),ShortDate) & " - " & Text(DateValue('ContractPeriod:EndDate'.Value,"en-US"),ShortDate)})

 

On Update, I'd like to save the ID. I've tried cboAID.Selected.CID and I'm getting an error that it's expecting a record. So I remove CID and enter cboAID.Selected, I don't get the error but my ID doesn't save. 

 

Any idea on how to save the ID?

 

ruth

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    155,495 Most Valuable Professional on at

    Hi @ruth ,

    What is the name and type of field you are writing back to? If it is a Lookup field (which I suspect), what is the list name and field name it is looking up?

  • ruth Profile Picture
    212 on at

    Yes, it is a lookup field. The list name is audit and the field name is the ID. An audit can have multiple observations. So I need to store the audit id in the observations list.

  • WarrenBelz Profile Picture
    155,495 Most Valuable Professional on at

    Hi @ruth ,

    You are Patching Audit - what is the name of the field and list that the Lookup field in audit you are trying to patch is looking up? 

  • ruth Profile Picture
    212 on at

    Hi @WarrenBelz ,

     

    Observations links to Audits via the Audit ID (internal ID) field. In the Observations list, I have AID which is a lookup to the Audit ID.

     

    ruth

  • Verified answer
    WarrenBelz Profile Picture
    155,495 Most Valuable Professional on at

    Hi @ruth ,

    To confirm, the field in Audit which is shown in cboAID (Combo Box) is called 'Audit ID', which is a lookup to a field called AID in the Observations list? If so your update will be something like this

    {
     Value:cboAID.Selected.xxxx,
     Id:
     LookUp(
     Observations,
     AID = cboAID.Selected.xxxx
     ).ID
    }

    with xxxx being the valid output of the combo box (you have not told me the Items)

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • WarrenBelz Profile Picture
    155,495 Most Valuable Professional on at

    Hi @ruth ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • ruth Profile Picture
    212 on at

    Thanks @WarrenBelz , I have not resolved it yet. Had to put it aside, but am back on it.

     

    I had to read your response a few times as I think you have it reversed.

     

    Audit ID is in the Audit list - it uniquely identifies an Audit though it is the Sharepoint generated ID. In the Observations list, AID is a lookup to the ID in the Audit list.  So, an audit consists of one to many observations.

     

    Here is the cboAID items code:

     

    ForAll(
    'Audit',
    { CID: ID,

    cboDisplay: ID & " - " & ContractPeriod.Value & ": " & Text( DateValue( 'ContractPeriod:BegDate'.Value, "en-US"), ShortDate) & " - " & Text(DateValue('ContractPeriod:EndDate'.Value,"en-US"),ShortDate)
    }
    )

     

    Ruth

  • ruth Profile Picture
    212 on at

    @WarrenBelz THANKS!! This did it. I just changed Observations to Audit and plugged in the corrected ids. Works GREAT Thanks, sooo much!!!!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 385

#2
Vish WR Profile Picture

Vish WR 367

#3
timl Profile Picture

timl 340 Super User 2026 Season 1

Last 30 days Overall leaderboard