cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Adding information from Sharepoint list to textbox

Hi,

 

I am trying to create an E-Mail template that gets information from powerapp or Sharepoint list that also changes according to dates.

I am trying to get this information in the powerapp or from the sharepoint list as the powerapp gets this information from the list as well.

Sandkastnrocker_0-1632419186270.png

The information with date and title comes from "Wochenplan" to "E-Mail"

Sandkastnrocker_1-1632419225696.png

and it should be added in either Textinput or Richtext or HTML. It should grab the information and add the date in one area (XXXX) and the titel in the other (XXXXX). 

Sandkastnrocker_2-1632419287629.png

Also it should know if I click the Mail button on either of the three topics which title to grab and which date as it is different each week and for each topic.

Sandkastnrocker_3-1632419583836.png

I dont even know if it is possible to include information like that but I am afraid it seems to be really complicated at least for a beginner like me.

 

If you have any ideas it would be highly appreciated. Thank you

 

1 ACCEPTED SOLUTION

Accepted Solutions
BCLS776
Super User
Super User

I made a demonstration app to show how I would set it up:

Animation.gif

 I suggest putting only:

Select(Parent);
Navigate('E-mail');

In your button to change screens, and then referencing the Selected item from the gallery after that.

 

I don't quite understand your need for 3 mail buttons - are there three different kinds of emails you want to send?

 

Bryan

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

View solution in original post

13 REPLIES 13
BCLS776
Super User
Super User

To give you an exact answer, we need to know more about the columns in your Sharepoint list and how you would use a date to choose the right record.

 

Chances are, you will use the LookUp() function to find a record in your list that matches the given criteria. Example:

// put this in the Text property of a label and adjust your column/list names to fit

LookUp(mySPList, ID = 1, Title)

// This looks for the first record in mySPList with an ID = 1, and then returns the value in the Title column for that record

// ID = 1 could be replaced by ID = Label1.Text to reference a control instead

If you can tell us more info about your situation, we can help you build a LookUp that suits your case.

 

Hope that helps,

Bryan

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

Hi,

 

I use a Sharepoint list with a column "Date and Time" with standard formatting.

Sandkastnrocker_0-1632471417418.png

In Powerapps Date/Time is a Textbox which uses: 

ThisItem.Startzeit

 

The Gallery with the date/time has this information in Items:

SortByColumns(
Filter(Ausbildungsplan;Startzeit>=Today()&& Startzeit<=DateAdd(Today();42))
;"Startzeit")

 

I changed the Textbox to "Textinput1" as it loads a lot faster than Richtext and you dont need any fancy writing options. Most of the time you will just send the Mail as it is, preferably already with the Date/Time information so you dont have to type it in yourself.

 

The Mail button has the following information:

Notify("E-Mail wurde verschickt";NotificationType.Success;3000) &
Office365Outlook.SendEmailV2("ausbildung@feuerwehr-langenselbold.de";"Ich möchte ein Ausbildungsthema übernehmen";TextInput1) &
Navigate(Wochenplan)

Sandkastnrocker_1-1632471848868.png

I hope I included all necessary information.

BCLS776
Super User
Super User

OK, it sounds to me like you want to populate the text box with a default message, which can be edited and then used to send as the body of the email message, right?

 

If so, try some code like this in the Default property of the text box:

LookUp(Ausbildungsplan;
    Startzeit <= Now()&& Endzeit >= Now(); // This is the matching condition
    'HT_Titel' // This is the column to find the return value
);;

Let us know how that works for you,

Bryan

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

Thank you Bryan.

 

So far it works with the current date which is great. Unfortunately that seems to be only the start and my description of what I am trying to do doesnt seem to be good enough so I aplogize and will try once more to try to describe what I am trying to do. So dont worry if it might be too complicated or I am not able to fully describe what I need so you can help out. If it is so, than I will just go with the first idea of mine and let the user fill in the data.

So what am I trying to do:

I have a training schedule for one day each week with three different topics each week. My App always shows the next 42 days so usually 6 weeks and 6 different training plans.

There are some weeks and topics displayed without a trainer. I am trying to give the users the opportunity to click on a Mail symbol for a topic that is missing the trainer and send an E-Mail that they want to be the trainer for that day. So the topic and the date is always different, sometimes there are one, two or three topics without trainer for the same date. 

 

I was trying to find a solution on how the app knows that If you click on topic, for example "Zug-/Objektübung extern" with date "12.10.2021" that it automatically ads this topic name and the date and not any other week or topic. Or you click on the mail symbol in "Modul 1" with the topic name "TH-VU LKW" It should grab that topic name and the date "28.09.2021" and not maybe "12.10.2021"

How do I let the powerapp know that If I click on a mail that it picks the corresponding date and topic?

 

To show what I have. It is a vertical gallery with three topics that is linked with the Sahrepoint list and always displays the next 42day/6weeks in the list "Ausbildungsplan" and copies all the information from there into the fields.

Sandkastnrocker_2-1632497438442.png

My solution so far is that I just added a mail symbol that navigates to a new screen and added the textinput and mail confirmation button but of course that is the same symbol for every topic in a week even though its three different topics.

 

So maybe I was able to clarify a bit better what I am trying to do. It is always really hard for me to describe what I am trying to do especially in a foreign language.

Just to add: I was able to create the textbox exactly how I want it to look like with the information through lookup. That is already a big step.

 

"Ich möchte gerne die Ausbildung für das Thema: " & Char(10) &
LookUp(Ausbildungsplan;Startzeit>=Today()&& Endzeit>=Now();'HT Titel'.Value & Char(10) &
"am " & Char(10) &
Startzeit) & Char(10) &
"übernehmen."

 

Sandkastnrocker_0-1632499165728.png

 

I "just" need a solution that it knows for what date and topic the trainer want to do and not just the next one.

 

My understanding of German is non-existent, so you're way ahead of me 🙂

 

Anyways, it looks like you are using a gallery, so there is more functionality we can use to help you out. A very handy reference is Selected, which refers to the record currently selected in the gallery. For example, GalleryName.Selected.Startzeit will bring up the associated start date for the currently selected record. Your button only needs to have the OnSelect code of Select(Parent) and then your email template fields will have references  ,such as GalleryName.Selected.Startzeit, in them. Try referencing one of your columns using this in the Default property of that email text box to demonstrate this functionality.

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

Uh I am all giddy right now because I feel I am close to the solution. The selected works and gets the dates right so I am very hyped about that.

I have changed the 3 mailbuttons to

 

Gallery3.Selected.'HT Titel'.Value&
Gallery3.Selected.Startzeit&
Navigate('E-Mail')

 

Gallery3.Selected.'M1 Titel'.Value&
Gallery3.Selected.Startzeit&
Navigate('E-Mail')

 

Gallery3.Selected.'M2 Titel'.Value&
Gallery3.Selected.Startzeit&
Navigate('E-Mail')

 

So Powerapps should know that I need both items.

How do I make it so that it knows If I click the button in "Modul 1" that it should display the "Modul 1" and not the others. I think it works with "If" but I am not quite sure yet how it should be like so I dont get errors.

BCLS776
Super User
Super User

I made a demonstration app to show how I would set it up:

Animation.gif

 I suggest putting only:

Select(Parent);
Navigate('E-mail');

In your button to change screens, and then referencing the Selected item from the gallery after that.

 

I don't quite understand your need for 3 mail buttons - are there three different kinds of emails you want to send?

 

Bryan

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

I only want to send one E-Mail with the same purpose.

I have three topics that get their information from three different columns in Sharepoint so they all have different Names.

Column 1 = HT Titel = your Session 1

Column 2 = M1 Titel = your Sesson 2

Column 3 = M2 Titel = your session 3

 

How does the textbox know you clicked Session 2 and 3 if it only says "Gallery.Selected.Session and not

Gallery.Selected.Session1

Gallery.Selected.Session2

Gallery.Selected.Session3

 

I feel like I am missing the rest of the Default text

 

All three topics are in one Gallery box? . Is it the same in your example? I dont know.

 

Actually I dont know what I am thinking overall. I though when I volunteered to do that it might be quick an easy. I never worked with any kind of programming language and started with that app maybe 2-3 weeks ago from scratch. It is for our volunteer fire department so I am not even paid to bother others. Its all babysteps and I am just so happy that you took your time to help out and go mad trying to understand what I am doing or not doing.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (1,991)