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 / newform avec recuperat...
Power Apps
Unanswered

newform avec recuperation champs galery

(0) ShareShare
ReportReport
Posted on by 16

Bonjour

 

j'aurai encore besoin de votre aide.

j’ai une galery1 avec une liste d’éléments, quand je clic sur un élément onselect : Navigate(FORM1)

une fois dans mon formulaire j’ai un champs ID qui reprend mon ID de ma galery1 sélectionné, Item :LookUp ('FORM1';ID = galery1. Selected.ID)

 

ce formulaire fait un enregistrement sur une source de donnée google Sheets autre que celle de ma galery1

 

par contre j’ai besoin de votre aide car quand je clic sur enregistrer : SubmitForm(FORM1), il me modifie mes champs sur ma source de donnée google Sheets lié a mon ID, mais je voudrais plutôt créer un nouvel enregistrement tout en gardant mon ID sélectionné sur ma galery1.

 

J’ai essayer avec newform(FORM1) mais ca ne marche pas.

 

MERCI

Categories:
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Bonjour @chriss59194 

    You can arrange your form so that it works as it is supposed to. Every properly constructed table in a database should have a unique ID field that is not reused if the record is deleted. Since both Excel and Google sheets does not assign its own ID to a table, you have to do it yourself.  You can use the same form for a New as well as Editing an existing record.  The function NewForm( Form1) and EditForm(Form1) establishes the proper milieu and should be used in the command that Navigates to the form from another screen. 

    When you create a new record using the NewForm(Form1) function you will need to assign a new record number to your google sheets so you would make the default for the ID field .

     

    Coalesce(
     Parent.Default, First(
     Sort(
     Table, ID, Descending
     )
     ).ID+1
    )

     

    If you are Navigating to the form to modify an existing record use EditForm(Form1) with the Navigate() function. This way the Form is in Edit mode.  Then the function above will use the Parent.Default but if it is in New form mode, then Parent.Default will be blank and the formula above will assign the next ID in sequence to the ID field  It is important to either hide or disable this card to the User cannot change it.

    If you want to keep a relationship to the table in your gallery (say if it was a Parent/Child relationship between two different tables, you would need to have the Parent ID in the Child table as the parentID field.  It should be a number in the second table, In the Form, there will be a card for it.  Inside the card for the parentID, there will be a control and its Default property should be set to Gallery.Selected.ID.  Also disable this card so it can't be changed by the user.  To better understand how to use Keys to create the relationships between tables in your app, please see my blog here https://powerusers.microsoft.com/t5/News-Announcements/Relational-Database-Principles-and-PowerApps-Step-3-Keys-and/ba-p/188640 .  The post following it shows how to implement that relationship in PowerApps.   https://powerusers.microsoft.com/t5/PowerApps-Community-Blog/Relational-Database-Design-fundamentals-Implementing-a-One-to/ba-p/200521  

  • chriss59194 Profile Picture
    16 on at

    bonjour,

    en fait mon ID provient d’une liste d’équipement et mon formulaire les pannes sur l’ID de l’équipement en question donc dans ma table de donnée je vais retrouvé plusieurs ligne avec le même ID, c'est pour cela que dan s mon formulaire j’ai récupéré mon ID de ma galery1, avec un ITEM : :LookUp ('FORM1';ID = galery1. Selected.ID)

    mais quand j’enregistre il me fait une modification alors que je voudrais qu’il crée une nouvelle ligne

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @chriss59194 

    If your list has several ID's that match the one selected in your gallery, Lookup will find the first one, not necessarily the one you want.  Also check the Update property of the card containing this field.  It may not be reflecting the value in the control inside the card. 

  • chriss59194 Profile Picture
    16 on at

    J'ai 2 table une avec la liste de mes équipement avec 1 seul ID par équipement ( ma galery1) est une 2ieme table avec les enregistrements de panne avec plusieurs ID (FORM1) 

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 394 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 324 Most Valuable Professional

Last 30 days Overall leaderboard