Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
lg01
Helper I
Helper I

Pass parameter's values to a function from marked records

In my project I have a table created from a POST call to a REST service. The service populates the table just fine with fixed values passed to the service's paramenters. I then try adding my own paramenters to our function call in order to make it dynamic. The issue I have is that I want to pass values to the paramenters from marked record on the charts. So, for instance, say that I marked a record on a table or on a map, and that record has a key value in one of its columns. I want to call the function, pass the value of the key column in the record selected to the function and repopulate the table with the new payload coming back from the REST service. Below is the service call I use to populate the table:

 

()=>

let


body = Text.Combine({"{
    ""parameters"": {
     ""ItemId"" : ", inputIdParamenter, ",
     ""startDate"" : ", inputStartDateParameter, ",
     ""endDate"" : ", inputEndDateParameter, "
}
}"}),



Data=Json.Document(
              Web.Contents(
                      "https://mydomain.com/",
                       [
                          RelativePath="path/to/my/service/execute",
                     Headers=[
                            #"Content-Type"="application/json",
                             Authorization=GetAccessToken()
                           ],
                   Content=Text.ToBinary(body)
      ]
     )
),

well_data = Data[value]

in

well_data


 

2 REPLIES 2
v-xinruzhu-msft
Community Support
Community Support

Hi @lg01 

Based on your description, do you mean that you select the value in visual, then you need to pass the value from visual to the function?

 

Best Regards!

Yolo Zhu

Yes, that is correct. That is exactly what we are trying to do. 

Helpful resources

Announcements
September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.