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

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Create new item in sub list from item in gallery

(0) ShareShare
ReportReport
Posted on by 93
Hi everyone.
 
I'm trying to build a meter readings register app from two lists, Meters and Meters readings:
 
Meters
Meter Name Info Info
Meter 1 etc etc
Meter 2 etc etc
 
Meters readings
Meter Date Reading
Meter 1 11/01/2025 2356
Meter 2 11/02/2025 8945
Meter 1 11/02/2025 2368
Meter 2 11/02/2025 8977
 
Meter in Meter readings is a lookup from Meter Name in Meters. I'm trying to build the app around two screens, the first lists the meters. After one of the listed meters is selected, it must go to a following edit screen so the user can create a reading record to the selected meter in the first.
 
First screen listing the meters (registered in the Meters list):
Meter selection screen
 
As explained before, after selecting the 6-MAC05185-RED ETA Amélia Rodrigues, example given, It must go to the Meter readings screen:
 
Those fields are in the Meter readings list and the field "Macromedidor" (please forgive the field names confusion, my native language is portuguese) is the lookup in Meters.
How can I select a meter in the first screen and make it appear automatically in the Meter ("Macromedidor") field for a new register, like above?
 
Thank you in advance!
I have the same question (0)
  • Suggested answer
    venturemavenwill Profile Picture
    945 Super User 2025 Season 2 on at
    Create new item in sub list from item in gallery
    Assuming you are using Dataverse, a Dataverse Lookup field always include the GUID of the lookup record, which you can access when you type a '.' at the end of the column name. You can store this value using something like a Set operation
     
    Set(varMeterId, Meter.Meter)
    or something similar. Do this when you click on the value. 
     
    In the item parameter of the Meter table, just do a lookup that looks for the record with the same ID
     
    Lookup(Meter, Meter = varMeterId)
     
    This should pull up the record in your form. 
  • Verified answer
    Ytalo Silva Profile Picture
    169 Super User 2025 Season 2 on at
    Create new item in sub list from item in gallery
    Hello, assuming you’re saving the selected data from the gallery “Leitura de Macromedidores” into a variable called varMacromedidorSelecionado, you can go to the DefaultSelectedItems property of the ComboBox for the Macromedidor field (or any similar one) on the Meter Screen and add the following formula:
    {Value: varMacromedidorSelecionado.Macromedidor}

    I’m assuming the selected Macromedidor data is stored in the variable varMacromedidorSelecionado. In this case, we use the dot (.) to access specifically the Macromedidor column (replace it with the actual column name you want to display).
     
    We then wrap it with {Value: } in the DefaultSelectedItems property of the ComboBox to set the default value correctly.
     
    I hope this helps!
  • William_Azevedo Profile Picture
    93 on at
    Create new item in sub list from item in gallery
    @venturemavenwill, I'm using SharePoint lists. Does it apply?
  • William_Azevedo Profile Picture
    93 on at
    Create new item in sub list from item in gallery
    Thank you, @Ytalo Silva, it worked!
    And since I'm here: I also implemented a Save button with the following code:
     
    SubmitForm(frmInsercaoLeitura);;
    Navigate(scrTelaPrincipal; ScreenTransition.None)
     
    Everything works fine, except for the fact that the meter is not saved to the list along with the other data:
     
    If this is not the place to ask that, please, let me know.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 686 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 433 Super User 2025 Season 2

#3
wolenberg_ Profile Picture

wolenberg_ 266 Moderator

Last 30 days Overall leaderboard