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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
NickzNickz
Helper IV
Helper IV

Query Token Literal Expected Error

Hi ... 

I have reciece an error as below. How can i resolve the error ... 

 

 

 

 

let
    //Get list of files in folder
    Source = Folder.Files("imagas_path"),
    //Remove unnecessary columns
   RemoveOtherColumns = Table.SelectColumns(Source,{"Content", "Name"}),
    // Creates Splitter function
    SplitTextFunction = Splitter.SplitTextByRepeatedLengths(30000),
    //Converts table of files to list
    ListInput = Table.ToRows(RemoveOtherColumns),
    //Function to convert binary of photo to multiple
    //text values
    ConvertOneFile = (InputRow as list) => 
        let
            BinaryIn = InputRow{0},
            FileName = InputRow{1},
            BinaryText = Binary.ToText(BinaryIn, BinaryEncoding.Base64),
            SplitUpText = SplitTextFunction(BinaryText),
            AddFileName = List.Transform(SplitUpText, each {FileName,_})
        in
            AddFileName,
    //Loops over all photos and calls the above function
    ConvertAllFiles = List.Transform(ListInput, each ConvertOneFile(_)),
    //Combines lists together
    CombineLists = List.Combine(ConvertAllFiles),
    //Converts results to table
    ToTable = #table(type table[Name=text,Pic=text],CombineLists),
    //Adds index column to output table
    AddIndexColumn = Table.AddIndexColumn(ToTable, "Index", 0, 1)
in
    AddIndexColumn

 

 

NickzNickz_0-1703809994487.png

NickzNickz_1-1703809813145.png

 

NickzNickz_0-1703809750184.png

 

 

Regards,

Nickz Nickz

 

 

1 ACCEPTED SOLUTION
v-jincheng-msft
Community Support
Community Support

Hi @NickzNickz ,

Thanks for the information you have given.

After analysing the code you provided, we found that in the statement "ConvertOneFile = (InputRow as list) =>", "&gt" means ">" in HTML but it does not work in M language. This is probably a transcoding error that occurred during the copying of the code.
The corrected line of code should read:

ConvertOneFile = (InputRow as list) =>

In addition, we recommend avoiding the use of multiple "let... in..." .

Hope it helps!

 

Best regards,
Community Support Team_ Joseph Ji

 

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-jincheng-msft
Community Support
Community Support

Hi @NickzNickz ,

Thanks for the information you have given.

After analysing the code you provided, we found that in the statement "ConvertOneFile = (InputRow as list) =>", "&gt" means ">" in HTML but it does not work in M language. This is probably a transcoding error that occurred during the copying of the code.
The corrected line of code should read:

ConvertOneFile = (InputRow as list) =>

In addition, we recommend avoiding the use of multiple "let... in..." .

Hope it helps!

 

Best regards,
Community Support Team_ Joseph Ji

 

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

Fowmy
Super User
Super User

@NickzNickz 

It seems, you have use =&gt here the correct syntax should be 

ConvertOneFile = (InputRow as list) =>

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.