Skip to main content

Notifications

Power Apps - Building Power Apps
Suggested answer

Editing an existing record without using record ID

Posted on 27 Nov 2024 19:56:42 by 74
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?

 
 
  • WarrenBelz Profile Picture
    WarrenBelz 143,137 on 27 Nov 2024 at 22:16:56
    Editing an existing record without using record ID
    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
     
     
  • Pstork1 Profile Picture
    Pstork1 63,813 on 27 Nov 2024 at 21:04:29
    Editing an existing record without using record ID
    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
     
  • TJCappy Profile Picture
    TJCappy 74 on 27 Nov 2024 at 21:00:40
    Editing an existing record without using record ID
    @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.
  • TJCappy Profile Picture
    TJCappy 74 on 27 Nov 2024 at 20:54:20
    Editing an existing record without using record ID
    @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
        )
    )



     
     
     
  • WarrenBelz Profile Picture
    WarrenBelz 143,137 on 27 Nov 2024 at 20:19:34
    Editing an existing record without using record ID
    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 ? 
  • Suggested answer
    Pstork1 Profile Picture
    Pstork1 63,813 on 27 Nov 2024 at 20:19:28
    Editing an existing record without using record ID
    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

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,137

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,813

Leaderboard