Hi,
I'm trying to build my own inspection app and I cannot find a solution for my idea.
I have a SharePoint list with Questions (the question are managed from that list if needed more or change):
A person who is responsible for inspections can go to the screen "Create new audit", select who will be the Audit for that audit and press Create button.
As you can see above, I have a list called "Audits".
After someone presses Create, a new entry should be added to this list (I know how to achieve this) but also I would like all questions to be copied to AuditsQuestions list with their Audit ID number.
How can I achieve this?
I am also open to other solutions.
Thank you.
Regards
Slawek
Solved! Go to Solution.
When you go to create a new audit, do this:
/*
If you need to use this data through your app, use a global variable. Regardless of the variable, the result will be a record that the Patch function returns, containing the ID of the saved item.
*/
UpdateContext({
varNewAudit:
Patch(
Audits,
Defaults(Audits),
{
//...
}
)
});
ForAll(
Questions,
Patch(
AuditsQuestions,
Defaults(AuditsQuestions),
{
AuditID: varNewAudit.ID,
Question: ThisRecord.Question,
Section: ThisRecord.Section
}
)
)
Hi! I hope I was helpfull. Please always mark the answer that helped you, so others who need it will find it faster.
When you go to create a new audit, do this:
/*
If you need to use this data through your app, use a global variable. Regardless of the variable, the result will be a record that the Patch function returns, containing the ID of the saved item.
*/
UpdateContext({
varNewAudit:
Patch(
Audits,
Defaults(Audits),
{
//...
}
)
});
ForAll(
Questions,
Patch(
AuditsQuestions,
Defaults(AuditsQuestions),
{
AuditID: varNewAudit.ID,
Question: ThisRecord.Question,
Section: ThisRecord.Section
}
)
)
Hi! I hope I was helpfull. Please always mark the answer that helped you, so others who need it will find it faster.
Hi @Roverandom
thank you very much!
This is what I needed and by this example, I learned something new.
Regards
Slawek
User | Count |
---|---|
251 | |
102 | |
94 | |
48 | |
37 |