cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dobroo
Level: Powered On

Create daily SP List Items from another list entry

Hi Experts,

 

I need your help to implement the follwoing idea:

 

List1:

Name:

Quantity:

From: 

To:

 

Now I want to create one entry per day in the period (To: - FromSmiley Happy in another list with the columns

 

List 2:

Date (From:-ToSmiley Happy:

Name (from App1):

Quantity (from App1):

Done (Yes/No):

 

One Example:

In List 1 the entry:

Name: Test

Quantity: 10

From: 08/02/2019

To: 12/02/2019

 

Creates the entries in List2:

Date (From:-ToSmiley Happy:                Name (from App1):               Quantity (from App1):               Done (Yes/No):

08/02/2019                        Test                                         10                                              No

09/02/2019                        Test                                         10                                              No

10/02/2019                        Test                                         10                                              No

11/02/2019                        Test                                         10                                              No

12/02/2019                        Test                                         10                                              No

 

 

OR 

implement this not with a SP List2 but with Office Plan.

Therefore I have to work with Microsoft Flows.

 

I'm not sure which one is the better.

Can I receive your opinion?

 

Thx Olli

 

2 REPLIES 2
Community Support Team
Community Support Team

Re: Create daily SP List Items from another list entry

Hi @dobroo,

 

Do you want to create SP list 2’s Date(From-To) from SP list one’s two date columns?

And what the column type of Name (from App1): ,Quantity (from App1):?

Are they look up column type?

And you want to use another method except flow to achieve that?

I think PowerApps can also achieve it.

You can try following workaround.

 

I test as next:

Data Source:

20190211DailiSpList1(my sp lsit1 name)

Names(single line)

Quantity(Number type)

From(Date type)

To(Date type)

20190211dailisplist1.png

20190211dailysplist2(my sp list2 name)

DFT(Date type, it means Date(From-To))

Done(choices type)

Names_Lookup( look up column type, from sp list1’s Names)

Quantity_lookup(look up column type,from sp list1’s Quantity)

 20190211dailisplist2.png

App Test:

Add one edit form and its DataSource: '20190211dailysplist2'

Add two dropdown control and rename them as Dropdown_From,Dropdown_To.

Dropdown_From.Items: Distinct('20190211DailySpList1',From)

Dropdown_To.Items: Distinct('20190211DailySpList1',To)

Add one button rename it Button_DateRange,Button_DateRange.OnSelect:

ClearCollect(DateRange,AddColumns( FirstN( [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29],

            DateDiff(Dropdown_From.Selected.Result, Dropdown_To.Selected.Result, Days) + 1)

       "Date",DateValue(Text( DateAdd(Dropdown_From.Selected.Result, Value, Days),"[$-en-US]mm/dd/yyyy")) )) 

Add one listbox control to show your convert daterange to dates: ListBox1.ItemsSmiley Very HappyateRange.Date

Add icon6 and icon7 ,icon7.OnSelect: NewForm(Form7)

                                        Icon6.OnSelect:

Set(odataVar,"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference");ForAll(DateRange,Patch('20190211dailysplist2',Defaults('20190211dailysplist2'),{TitleSmiley Very HappyataCardValue54.Text,DFTSmiley Very HappyateRange[@Date],

DoneSmiley Sad{'@odata.type'Smiley SurpriseddataVar,ValueSmiley Very HappyataCardValue58.Selected.Value}),Names_Lookup: {

        '@odata.type' : odataVar,

        Value: DataCardValue59.Selected.Value,

      Id:1},Quantity_lookup: {

        '@odata.type' : odataVar,

        Value: DataCardValue60.Selected.Value,

      Id:1}}))

20190211dailysplistapptest1.jpg

Result Test:

1.

20190211dailysplistresulttest1.jpg

2.

20190211dailysplistresulttestgif.gif

3.

20190211dailysplistresulttest3.png

 

Hope this can be helpful.

Best Regards.

Yumia

 

dobroo
Level: Powered On

Re: Create daily SP List Items from another list entry

Hi @v-yuxima-msft,

 

thx a lot for this tutorial Smiley Happy

 

I have some problems to understand this formula:

Set(odataVar,"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference");ForAll(DateRange,Patch('20190211dailysplist2',Defaults('20190211dailysplist2'),{TitleSmiley Very HappyataCardValue54.Text,DFTSmiley Very HappyateRange[@Date],

DoneSmiley Sad{'@odata.type'Smiley SurpriseddataVar,ValueSmiley Very HappyataCardValue58.Selected.Value}),Names_Lookup: {

        '@odata.type' : odataVar,

        Value: DataCardValue59.Selected.Value,

      Id:1},Quantity_lookup: {

        '@odata.type' : odataVar,

        Value: DataCardValue60.Selected.Value,

      Id:1}}))

 

Not only because of the smileys. Smiley Happy

I think I changed the smiley correctly.

 

I haven't work with the formula for the choice type: As example

Quantity_lookup: {

        '@odata.type' : odataVar,

        Value: DataCardValue60.Selected.Value,

      Id:1}

 

I have to transform it in my region. So I hope that is correct:

Quantity_lookup: {

        '@odata.type' : odataVar;

        Value: DataCardValue60.Selected.Value;

      Id:1}

 

Second Question: Why is the ID:1 ?

 

Answers to your questions:

Do you want to create SP list 2’s Date(From-To) from SP list one’s two date columns?

Yes. List2 should be automatically create from the Dates in list 1.

And what the column type of Name (from App1): ,Quantity (from App1):?

Are they look up column type?

Yes. They are look up column type

And you want to use another method except flow to achieve that?

Not necessarily. What is the best way. I like your Example and this will be perfect. Some changes and I think it will grow Smiley Happy

 

Hope this can be helpful.

Yes it is. But it doesn't work so far.

 

Best Regards.

Oliver

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, August 21st at 8am PDT

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

SixthImage

Power Summit Australia 2019

August 20-23rd 2019

Users Online
Currently online: 36 members 4,062 guests
Please welcome our newest community members: