Forum Discussion

rpc1235x's avatar
rpc1235x
New Contributor II
2 years ago
Solved

Dynamic range of dates for REST

My current pipeline works with pipeline parameters defining the range of dates

However my goal is to automatize this for each month. My idea is to schedule a task for the first of every month and I would like to dynamically set date2 as Today minus one day in yyyy-mm-dd format (no time) and date 1 as Today minus one month. So that if Today is October first, then date 2 is 2023-09-30 and date 1 is 2023-09-01.

To accomplish this, I am trying to utilize the query parameters section in the REST Get snap. However, I am not able to properly create the functions. As I am not familiar with the snap functions and the documentation is not very explicit on how to combine multiple functions. I would appreciate any help. 

#RestGet #Dates 

  • akarsh 

    You just need to split the array using the JSON Splitter Snap, once you read the file and parse the content, so you will have the nested structure split and pipeline will process the records one by one. Then you can proceed with developing the rest of the logic.

    Note: You should use REST API Mode within the Salesforce Snaps, in order records to be processed one by one. 

3 Replies

  • psadasivam's avatar
    psadasivam
    New Contributor III

    @pranil2k2 - You can access your document inside template body by enabling “=” (toggle) expression mode. eg: ‘<body>’+$firstname+‘</body>’. you have multiple ways. Can you share sample output from mapper snap and your template to help further.

  • In Mapper i have two columns, and i need to configure in mail to show the table name and its stats.

    I am trying using below template as suggested in document but it is throwing error. is there any standard format to refer other than below?

    SMRT Load Stats

    Table Name

    +$$Table_name+

        <p>Table Stats</p> 
        <p>+$Table_Record_Count+</p> 
    

    Thanks Again

  • "

    SMRT Load Stats

    Table Name

    +$$Table_name+

        <p>Table Stats</p> 
        <p>+$Table_Record_Count+</p> 
    
    " i think it got broken
    • psadasivam's avatar
      psadasivam
      New Contributor III

      @pranil2k2, Just make sure you are passing array of JSON object to email Snap as shown below and Table-data path is set to $

      • kindminis's avatar
        kindminis
        New Contributor

        Hi, how would this work if I wanted to output multiple tables in one email body? Thanks.

  • Hi Sadasivam,

    Thanks for the reply. I am trying to use HTML Text option. but i am getting below error.
    for now i want to pass single table stats,as mapped in mapper.

    i want to display $Table_Record_Count, $Table_name values in Mail. please can you give some example on this scenario and if possible please share me the pipeline for reference.

    Thanks Again.

  • Hi,

    I tried to implement your method using Table but it is throwing error.

    Below is the syntax used in Mapper
    [{‘Table Name’: $TABLE_NAME,‘Count’:$COUNT}]