Hello Randy,
Me again! I'm trying to follow what you taught me in the Budget app I was working on as I have a similar use case with the Shipping App in the sense that I want to write the contents people wish to ship to a separate SharePoint list. I'm able to gather all of entries into the gallery as seen below, but I get errors when I try to write the Collection back to SharePoint via the Submit Form button. I've attached my screenshots and formulas in the Word doc (3 pgs). Would you mind taking a look and seeing if you can spot what I'm doing wrong? Thanks a mil, Teresa
Hi Randy,
Thanks for all your help with this. Let's put off the question of how to tie the Collection to a gallery of records for now. I marked your formula as the solution for this post. Thanks for helping me figure out how to write number values in a Collection back to SharePoint!
Teresa
Hi Randy,
I'm just trying to ensure that when the user clicks on a shipping request in the home screen that they will see the contents associated with that record. I have a column called ReqNumber in both the 'Domestic Shipping Requests' SharePoint list and the 'Shipping Request Contents' list. The ReqNumber for the 'Domestic Shipping Requests' data source is set in the OnSuccess of the frmMaster. I'm not sure how to get whatever number is generated into the 'Shipping Request Contents' list as well.
To recap...
The 5-digit req number is generated in the OnSuccess of frmMaster.
UpdateIf('Domestic Shipping Requests', ID=Self.LastSubmit.ID,{'Request Number': Self.LastSubmit.ID + 10000})
The OnSelect of my Submit Form button is. The Collect part of the formula should be in the OnSuccess formula above, correct? Still not clear on how to write the number that is generated above into the Collect formula. Can you help me out?
Set(
varPlaySpinner,
true
);
SubmitForm(frmMaster);
Collect('Shipping Request Contents',colContents);
Set(
varPlaySpinner,
false
)
The OnSelect of my "add to collection" button is:
Collect(colContents,
{Title: tiItemDescription.Text,
Value:Value(tiValue.Text),
Quantity: Value(tiQty.Text),
TotalValue: Value(lblSubTotal.Text),
Handling:ddHandling.Selected,
UOM:tiUOM.Text,
Year: Year(Now()),
Quarter: RoundUp(Month(Now())/3, 0),
Month: Month(Now()),
Requestor:
{
Claims: "i:0#.f|membership|" & Lower(varUser.Email),
DisplayName: varUser.FullName,
Department: "",
Email: varUser.Email,
JobTitle: ".",
Picture: "."
},
RequestorEmail: Lower(varUser.Email)
});
Reset(tiItemDescription);
Reset(tiValue);
Reset(tiQty);
Reset(ddHandling);
Reset(tiUOM)
Thank you Randy! Teresa
This is the information you will be getting in your OnSuccess action.
So you're saying that you need to add those to your 'Shipping Request Contents' (SRC) records!?
What are those columns in your SRC record schema? You just need to patch those in on the Collect in the OnSuccess action.
Thank you Randy! The formulas you provided recorded the Month, Quarter and Year as seen below.
Here is the latest version of my formula. I realized I am missing a tie in with the Master List which is called 'Domestic Shipping Requests'. I have 3 ID columns in the Domestic list based on the recent help you offered in the forums. One is of course the internal SharePoint ID, The other is ReqNumber which is the 5-digit string (e.g. 10005) and the last is AltReqNumber which is the date-based one. I'm using ReqNumber for the home screen gallery since I am short on space due to the number of columns. I was planning to use AltReqNumber for a Reporting Screen. Does it matter which of the 3 I use? Assuming I have the identical column names in my 'Shipping Request Contents' SharePoint list, how would I add it to the formula below to create the tie in? Thanks in advance for your help. Teresa
Collect(colContents,
{Title: tiItemDescription.Text,
Value:Value(tiValue.Text),
Quantity: Value(tiQty.Text),
TotalValue: Value(lblSubTotal.Text),
Handling:ddHandling.Selected,
UOM:tiUOM.Text,
Year: Year(Now()),
Quarter: RoundUp(Month(Now())/3, 0),
Month: Month(Now()),
Requestor:
{
Claims: "i:0#.f|membership|" & Lower(varUser.Email),
DisplayName: varUser.FullName,
Department: "",
Email: varUser.Email,
JobTitle: ".",
Picture: "."
},
RequestorEmail: Lower(varUser.Email)
});
Reset(tiItemDescription);
Reset(tiValue);
Reset(tiQty);
Reset(ddHandling);
Reset(tiUOM)
Yes...it's an ever changing landscape!! They became delegable within the past year.
Other changes of interest:
- Yes/No columns appear to now be delegable - with correct results.
- Records in a datasource will refresh themselves now without issuing a refresh (some restrictions apply). Note, this has nothing to do with the fact that you could always patch/update records in your datasource and have changes immediately reflect without a refresh. This has to do with records will update in your app when external (other app users or means) changes are made.
It's hard to keep track of them all and we all get stuck in the workarounds for when things didn't do that.
#2 - Ignore me! I was relying on old information. I was making the same point you did here. However, it looks like Microsoft has made dates a delegable function since.
Solved: Problems with delegation when filtering by date - Power Platform Community (microsoft.com)
I'm not entirely sure what you mean by #2. You can most certainly use the < and > on dates.
As for #3, if you've not used the monitor tool to diagnose issues with submitting to your datasource, I would suggest it highly as it will always tell you exactly what the issue is and you can correct from there. So, 5 or 50 doesn't make a difference as you'll be able to quickly see the problem in the monitor tool.
However, in relation to misplaced letters/misspelling, in general, you should not be using column names unless they are directly coming from the datasource in the record schema. The more you alter, the harder it is to design your app and the more problems you will have to troubleshoot.
Thanks for chiming in though...sometimes the more input the better!
Not so much because the Created date (SharePoint column) will not be available at the point that you are doing the Collect to the datasource.
But, there is no reason you can't include that in the collected record.
i.e.
{Tile: tiItemDescription.Text,
Value: tiValue.Text, //is this not a numeric also?? If so, Value(tiValue.Text)
Quantity: Value(tiQty.Text),
TotalValue: lblSubTotal.Text, //is this not a numeric also?? If so, Value(lblSubTotal.Text)
Handling: ddHandling.Selected,
UOM: tiUOM.Text,
Year: Year(Now()),
Quarter: RoundUp(Month(Now())/3, 0),
Month: Month(Now())
}
They would essentially reflect what was in the Created columns (once it is written).
Thank you for your input Dyee. I really appreciate how great everyone in the Community is about trying to help out those who are stuck. I tried the Year:Year(Now()), but it didn't work for me whether I wrapped it in a Value formula or not (my SharePoint column is a Number type column). #3 is good advice. Shane Young talks a lot about taking "baby steps" as a way to approach formulas to make troubleshooting easier. I'm curious to see what Randy will have to say about #2 since he is pretty good at abbreviating formulas.
Have a great day,
Teresa
Sorry to interrupt, I just notice a few things that might be helpful to you.
1) You can use the now formula to capture the date without a date picker. The formula would be Year(Now()).
2) I'd suggest making an extra column called DateNum. Generally, I do YearMonthDay the formula would be similar to Value(Year(Now())&If(Month>9,Month(Now(),0&Month(Now())&If(Day>9,Day(Now(),0&Day(Now())). The reason you would want to do this is you can't do > or < for dates. With a number value, you can use a date picker and convert it to a similar number format and then you can see everything greater than or less than that date.
3) When submitting fields, I generally like to submit fields in groups of 5. It's really hard to figure out what went wrong when submitting 30-40 fields. However, if you do it in groups of 5 it is easy to identify little things like a misplaced letter in your title or the field format is wrong. After you know 5 is good, you add another 5 until you're all the way done.
WarrenBelz
146,587
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,928
Most Valuable Professional