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 / Editing an existing re...
Power Apps
Answered

Editing an existing record without using record ID

(0) ShareShare
ReportReport
Posted on by 90
Hello
 
I am hoping someone will have a solution for me.

I have tried several solutions and had no luck with any.   Here is my issue.
 
I have a PowerApps Canvas app that I have put together.  The app has just a few screens,
  1.  Startup Screen  - this lets the used decide which route the want to take. Options are New Item or Edit Item.
  2. New Item Screen - this screen has two forms on it and form two is only visible if certain criteia of form 1 oare met.  If form 2 is not visible the submit button submitts only form 1 if form 2 is visible then the submit button submits 1st form 1, captures the item ID and then submits form two adding the form 1 item ID to the form and submites it to the sharePoint List.  The sharepoint list for form 2 has a column called Form1ID where the form 1 ID is stored.
What I now need to do and am not succeeding relates to the edit screen.

I want to bring up on two different forms in the edit screen the data from both lists. to bring up the items I gave a gallery and when you click on an item it sets the variable value to the Form 1 item number.  I then use that variable to display the data, In items property I have varRequestID .  This brings up the form 1 Data without an issue.  

But I can't seem to find a way of bringing up the corresponding form 2 data, using the Form1ID number.  

Can anyone Help me?

 
 
Categories:
I have the same question (0)
  • Verified answer
    Pstork1 Profile Picture
    69,554 Most Valuable Professional on at
    There has to be some reference field in the Form2 list that ties the two lists together. Otherwise there is no way to do what you are trying.  When creating the new item what field are you adding the Form1 ID in Form 2? That is the field you need to use in a Lookup to get the related Form2 item.

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog

  • WarrenBelz Profile Picture
    155,779 Most Valuable Professional on at
    Can you please share the code you are using (in Text) and conform that you are using SharePoint.Also why are you using two forms rather than making Data Cards conditionally visible on one ? 
  • TJCappy Profile Picture
    90 on at
    @WarrenBelz​​​​​​​

    The info is being stored on two seoarate Lists, whic is also the reason for the two forms.
    Each form is saving and pulling  data to a different Sharepoint List.   

    The coding I have used is teh following:"
     
    ******
    LookUp(
    'Branch Call Out List', // this is the sharepoint List for form 2
    Form1ID = varRecordRequest.ID // Form1ID is the column in the list for Form 2 where I save the Form 1 ID #
    )
     
    ******
    If(
    !IsBlank(
    LookUp('Branch Call Out List', Form1ID = varRecordRequest.ID)
    ),
    LookUp('Branch Call Out List', Form1ID = varRecordRequest.ID),
    Defaults('Branch Call Out List') // Ensures the form stays in a valid state even if no record is found
    )
     
    ******
    If(
    !IsBlank(
    LookUp('Branch Call Out List', Form1ID = varRecordRequest.ID)
    ),
    LookUp('Branch Call Out List', Form1ID = varRecordRequest.ID),
    Blank()
    )
    ******
     
    First(
        Filter(
            'Branch Call Out List',
            Form1ID = varRecordRequest.ID
        )
    )



     
     
     
  • TJCappy Profile Picture
    90 on at
    @Pstork1

    There is a field in Form 2 that refers to Form 1 

    It is the Form1ID field that records the form one ID once form 1 is saved to the sharepoint site.
    so the Form 1 ID and the form2 [Form1ID] Field are the same for all records in the form 2 sharepoint.
  • Pstork1 Profile Picture
    69,554 Most Valuable Professional on at
    Then as @WarrenBelz says you can just use a Lookup to set the Item property of the Form2 field when editing.
     
    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
  • WarrenBelz Profile Picture
    155,779 Most Valuable Professional on at
    Yes - use the FormID value - you can capture the ID OnSuccess of the first form
    UpdateContext({varRecordRequest: Self.LastSubmit})
    then use varRecordRequest.ID as you have noted
     
     
  • TJCappy Profile Picture
    90 on at
    @WarrenBelz

    Thanks for your response,  

    I am not sure I understand your response.  

    Maybe I have not explained myself well so here is an example

    I submit a new Item that needs only form 1 and it creates item ID 23 on list 1.
    Then I submit a second New Item but now this item needs form 1 and 2.  It submits form 1 to List 1 to which assigns it ID 24   and form 2 to list 2 to which it assigns ID 10. 

    Item ID 10, whoever, saves form item ID 24 (corresponding to form 1's ID)   in the column called Form1ID

    Now when I go to edit the data using the Edit screen when I pick the record from the gallery it sets varRecordRequest as ID 24 (this is list 1's item ID).
     
    When the edit screen populates it populates EditForm1 with list one's Item 24 data.

    Up to here I have this working as required.
     
    What I can't seem to do, regardles of which formula I use,
    is populate Form 2 with the matching Data from list 2, i.e. list 2's ID 10  which should be matched using the column Form1ID  which displayys the #24 (list 1's ID)

    So basically I need a formula to input in form 2's Items property that will pull the item from list 2 based, not on the item ID Column but on the Form1ID column, which will match the varRecordRequest value.

    Thanks


     
  • WarrenBelz Profile Picture
    155,779 Most Valuable Professional on at
    Not totally clear here, but it seems you need the data from the second List plus some fields from the first list using a Default value of looking up the first list ?
  • TJCappy Profile Picture
    90 on at
     
    So after posting this I continued to play around and was able to do what i needed.

    So my form 1 works like your std Form.  it is always submitted to list 1
    Form 2 is ONLY submitted if the field [EmergencyContact] is yes.
    when I submit form 1, I get the item ID and copy that number to the field [FORM1ID]

    when I need to edit the form I click on the corresponding form in the gallery and it sets the varForm1ID to the number of the form 1 ID and pulls the respective items data.

    and if [Emergency Contact] is yes it now pulls up form 2 with the respective data and it does so by using the Forn1ID column to ID the correct item>

    with the item properties being 
    LookUp('Call out list', Form1ID = varForm2Lookup)

    thankyou for your assistance. your pointers were key to my finding the solution.

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 May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 477

#2
WarrenBelz Profile Picture

WarrenBelz 341 Most Valuable Professional

#3
11manish Profile Picture

11manish 317

Last 30 days Overall leaderboard