Passing in a string as dynamic content?

Mike Wong 46 Reputation points
2023-03-15T09:47:02.8466667+00:00

Hello,

I am currently using this expression for an Odata query in an API call:

?filter=occurred__gt: @{variables('start_date')};occurred__lt:@{variables('end_date')}&offset={offset}&pageSize=100

This works great when I pass it into a Copy Activity directly:

enter image description here

The issue is I'm building a dynamic pipeline where certain endpoints will need different Odata queries and I want to loop over a control table which is in SQL:

enter image description here

Although every time I read the Odata query from the SQL table it reads it as a string, not as dynamic content:

User's image

I have tried setting it as an expression:

enter image description here#

However, it still comes out as a string:

enter image description here

Is there a way I can have the Copy Activity read the odata query above as dynamic content?

Thank you!

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
5,373 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,623 questions
{count} votes

1 answer

Sort by: Most helpful
  1. ShaikMaheer-MSFT 38,546 Reputation points Microsoft Employee Moderator
    2023-03-16T14:12:12.9133333+00:00

    Hi Mike Wong,

    Thank you for posting query in Microsoft Q&A Platform.

    Above, is expected behavior. In Pipeline at this movement there is no function available which can convert your string into expressions. So ADF always treats it as string not as expression.

    You can consider below workarounds if they suits to your needs.

    • In Mapping data flows, there is a function called expr() which can convert strings to expressions. Click here to know more. You can consider using mapping dataflows if that works for you.

    OR

    • Try to build your string completely with values before using in API, so that you can directly use them in URL in API call.

    Hope this helps. Please let me know if any further queries.


    Please consider hitting Accept Answer button. Accepted answers help community as well.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.