Forum Discussion

powerbbbuuuuu's avatar
powerbbbuuuuu
Frequent Visitor
6 years ago

Error: (step 'Source') references other queries or steps, so it may not directly access a data sourc

I have a power query as follows:

 

Source = Text.Start(List.Accumulate(List.Distinct( #"perVM (2)"[crmID]), "" , (state, current) => state & "u_correlation_id=" &current & "^OR"),Text.Length(List.Accumulate(List.Distinct( #"perVM (2)"[crmID]), "" , (state, current) => state & "u_correlation_id=" &current & "^OR")) -3),

 

The first half before "Text.Length", gets the format of the string that I wanted it to be ( I've referenced other tables which was "perVM"[crmID]. The second half which starts from "Text.Length" till the end basically just ignores the last three characters that I do not need.

 

The above query intended to form the request params in the to call for the API. When I used it to call the API, it gives me the error in the heading.

 

How should I solve this issue?

 

Thanks

 

 

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi powerbbbuuuuu 

    your expression does exaclty what you described.

    I tested in two form, using a dummy list:

    1) yours as you wrote

    2) alternative form

                  Text.BeforeDelimiter(List.Accumulate({"c1","c2","c3"}, "" , (s, c) => s & "u_correlation_id=" &c & "^OR"),"^",{0,RelativePosition.FromEnd}).

     

    MAy be the problem is in the next line!?!?

    • powerbbbuuuuu's avatar
      powerbbbuuuuu
      Frequent Visitor

      I think this error is relates to not being able to use the value generated from other query as the parameter for the web request?.

       

      The query that I used generated a single string. -> Then I turned it into a list contains only single cell -> added this cell as query parameters -> queried the api with this value -> got me the error that I mentioned in the heading.

       

      Any idea on this ?